package ${cfg.remoteApiPackage};

import ${cfg.modelPackage}.${entity}DTO;
import com.liuyjy.base.common.entity.PageResult;
import com.liuyjy.base.common.entity.PageSearch;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;

/**
* <p>
    * ${table.comment!} remote接口类
    * </p>
*
* @author ${author}
*/
@FeignClient(value = "${cfg.applicationName}",url = "${cfg.scApiServiceId}", path = "<#if cfg.moduleName??>/${cfg.moduleName}/${table.entityPath}<#else>/${table.entityPath}</#if>")
public interface ${entity}Remote {
        /**
        * 分页查询
        *
        * @param info       查询条件
        * @param pageSearch 分页信息
        * @return
        */
        @PostMapping(value = "/queryListPage", consumes = MediaType.APPLICATION_JSON_VALUE)
        PageResult<${entity}DTO> queryListPage(@RequestBody ${entity}DTO info,
                                         @SpringQueryMap PageSearch pageSearch);

        /**
        * 列表
        *
        * @param info 查询条件
        * @return
        */
        @PostMapping(value = "/queryList", consumes = MediaType.APPLICATION_JSON_VALUE)
        List<${entity}DTO> queryList(@RequestBody ${entity}DTO info);

        /**
        * 根据Id值查询
        *
        * @param id id
        * @return
        */
        @GetMapping("/queryById")
        ${entity}DTO queryById(@RequestParam("id") Long id);



        /**
        * 修改或添加
        *
        * @param entity 实体对象
        * @return
        */
        @PostMapping(value = "/saveOrUpdate", consumes = MediaType.APPLICATION_JSON_VALUE)
        void saveOrUpdate(@RequestBody ${entity}DTO entity);


        /**
        * 删除对象
        *
        * @param id id
        */
        @GetMapping(value = "/del")
        void del(@RequestParam("id") Long id);

        }